
<%inherit file="base.mako" />
<script type="text/javascript">
var test = 0;
function appendPage(url,id) {
    //Insert the html returned from URL in the span with id 'id'
    var xmlhttp;
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if(xmlhttp.readyState==4) {
            
            document.getElementById(id+test).innerHTML+=xmlhttp.responseText+"<div id='"+id+(test+1)+"></div>";
            test++;
        }
    }
    xmlhttp.open("GET",url+"?number="+test,true);
    xmlhttp.send(null);
}


function getPage(url,id) {
    //Insert the html returned from URL in the span with id 'id'
    var xmlhttp;
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if(xmlhttp.readyState==4) {
            document.getElementById(id).innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function newClient() {
    document.getElementById("space").innerHTML = "<input type=button value='Nuevo Individuo' onclick=getPage('/tables_admin/new/client_data?rend=False&return_url=/serve_client/main','space')><input type=button value='Nueva Empresa' onclick=getPage('/tables_admin/new/company?basichtml=True','space')>"
}

function setInnerHtml(id,str) {
    document.getElementById(id).innerHTML=str
}

function filter(f,url,id) {
  getPage(url+"?name="+f.name.value+"&personal_id="+f.personal_id.value+"&telephone="+f.telephone.value,id)
//  alert(url+"?name="+f.name.value+"&personal_id="+f.personal_id.value+"&telephone="+f.telephone.value);
}

</script>
<input type=button name=nombre value='Siguiente' onclick="getPage('/next','nextchato');">

<div id="nextchato">
</div>

<form name="myForm">
<input type=button name=nombre value='Cliente Nuevo' onclick="newClient()">
<input type=button name=nombre value='Buscar Cliente' onclick="getPage('/serve_client/search','space');">
</form>
<br><br><br>
<div id="space">
</div>


